# -*- coding: utf-8 -*-
# @Time : 2022/1/14 10:46
# @Author : Limusen
# @File : demo_connect_01

import time
from appium import webdriver

des = {
    "platformName": "Android",
    "platformVersion": "9.0",
    "deviceName": "Samsung Galaxy S9",
    "appPackage": "com.android.calculator2",
    "appActivity": "com.android.calculator2.Calculator",
    "udid": "192.168.0.101:5555",
    "noReset": "True",
    "unicodeKeyboard": "True",
    "resetKeyboard": "True"
}

driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', des)

driver.find_element_by_android_uiautomator('text("7")').click()
time.sleep(1)
driver.find_element_by_android_uiautomator('text("8")').click()
time.sleep(1)
driver.find_element_by_android_uiautomator('text("9")').click()

driver.find_element_by_accessibility_id("删除").click()

driver.find_element_by_android_uiautomator('new UiSelector().description("删除")').click()


